## Script (Python) "getParentLink"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=Returns the absolute URL of the parent object, if any. (RepositoryItem)
##

from Products.CMFCore.utils import getToolByName

# Get the UID of the parent object
main_obj_uid = "FILE".join( context.UID().split( 'FILE' )[0:1] )

reference_tool = getToolByName(context, 'reference_catalog')
obj = reference_tool.lookupObject( main_obj_uid )
return obj.absolute_url() + '/view'
